<template>
  <div>
    <el-dialog title="关联产品" :visible.sync="dialogVisible" width="1300px">
      <el-form :inline="true" label-width="80px">
        <el-form-item label="合作商">
          <el-select v-model="listQuery.name" placeholder="请选择">
            <el-option label="重庆桐君阁" value="0" />
            <el-option label="安徽立方" value="1" />
            <el-option label="陕西玉龙" value="2" />
            <el-option label="重庆三美" value="3" />
          </el-select>
        </el-form-item>

        <el-form-item label="商品名称">
          <el-input v-model="listQuery.goodsName"></el-input>
        </el-form-item>

        <el-form-item label="是否关联">
          <el-select v-model="listQuery.name" placeholder="请选择">
            <el-option label="--" value="0" />
            <el-option label="已关联" value="1" />
            <el-option label="未关联" value="2" />
          </el-select>
        </el-form-item>

        <el-form-item label="批准文号">
          <el-input v-model="listQuery.approvalNumber"></el-input>
        </el-form-item>

         <el-form-item>
        <el-button type="primary">搜索</el-button>
      </el-form-item>

      </el-form>

      <el-table :data="list" height="250" border style="width: 100%">
        <el-table-column prop="productName" label="商品通用名">
          <template slot-scope="scope">
            <span>{{scope.row.productName}}</span>
          </template>
        </el-table-column>

        <el-table-column prop="specification" label="规格">
          <template slot-scope="scope">
            <span>{{scope.row.specification}}</span>
          </template>
        </el-table-column>

        <el-table-column prop="approvalNumber" label="批准文号">
          <template slot-scope="scope">
            <span>{{scope.row.approvalNumber}}</span>
          </template>
        </el-table-column>

        <el-table-column prop="productionFactory" label="生产厂商">
          <template slot-scope="scope">
            <span>{{scope.row.productionFactory}}</span>
          </template>
        </el-table-column>

        <el-table-column prop="shortName" label="合作商">
          <template slot-scope="scope">
            <span>{{scope.row.shortName}}</span>
          </template>
        </el-table-column>

        <el-table-column prop="resellPrice" label="库存/价">
          <template slot-scope="scope">
            <span>{{scope.row.resellPrice}}</span>
          </template>
        </el-table-column>

        <el-table-column prop="specification" label="是否关联"></el-table-column>

        <el-table-column align="center" label="操作">
          <el-button type="text"></el-button>
        </el-table-column>

      </el-table>

      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="submit()">保 存</el-button>
      </span>
    </el-dialog>

    
  </div>
</template>

<script>
import apigoodslibrary from "@/api/goodsManage/goodslibrary";
export default {
  name: "dialogGoodsRelation",
  components:{},
  data() {
    return {
      dialogVisible: false,
      total:0,
      list: [],
      listQuery: {
        currentPage: 1,
        showCount: 10,
        productName: "",
        isConnect: "",
        approvalNumber: "国药准字Z20044329"
      }
    };
  },
  created(){
    this.getList();
  },
  
  methods: {
    open(row) {
      this.getList();
      this.dialogVisible = true;
    },
    getList() {
      let data = apigoodslibrary.getComplainList();
      this.list = data.list;
    }
  }
};
</script>

<style scoped>
</style>